Repository navigation
Conversation
4992afc to
9df0441
Compare
9df0441 to
468d47a
Compare
346c0d3 to
f0596a8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f0596a8. Configure here.
| active_conditions_.reset(); | ||
| } | ||
| StartSynchronizers(); | ||
| } |
There was a problem hiding this comment.
Stale shutdown aborts FDv2 retry
High Severity
OnFDv2RetryTimer closes the FDv1 adapter while its Next() is still in the orchestrator's WhenAny. That unblocks the old future with Shutdown, which is posted onto the executor after the new FDv2 synchronizer has already been started. OnSynchronizerResult then treats that stale Shutdown as belonging to the replacement and resets active_synchronizer_, so the SDK is left with no live source after the TTL elapses.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f0596a8. Configure here.
| DataSourceStatus::DataSourceState::kInterrupted, | ||
| DataSourceStatus::ErrorInfo::ErrorKind::kUnknown, | ||
| kNoFDv1FallbackConfigured); | ||
| return; |
There was a problem hiding this comment.
Fallback status skips shutdown fence
Medium Severity
When a fallback directive arrives and no FDv1 tier is configured, the new path writes kInterrupted through status_manager_->SetState instead of PublishState. That skips GuardShutdown, so a late write after Close can overwrite the shared status that outlives this source.
Additional Locations (1)
Triggered by learned rule: Client FDv2DataSource: basis is selector; GuardShutdown fences store
Reviewed by Cursor Bugbot for commit f0596a8. Configure here.
|
Note Agent disclosure: this comment and the linked branch were produced by an AI agent (Claude Code) working for @kinyoklion, as part of a multi-agent review of this PR. The failure was reproduced and the fix checked by building and running the client unit tests locally (Debug, ASan/UBSan). Please review it with that in mind. The FDv2 retry after the fallback TTL tears down the synchronizer it just startedThis is the problem Bugbot raised here. It reproduces in a unit test, and it happens every time the TTL expires while the FDv1 tier is active. What happens (line links are at f0596a8):
After that there is no synchronizer and no retry timer, and the status still reads VALID from the last FDv1 data. Flag updates stop silently until the next identify. #619 gives every built-in mode an FDv1 fallback, so once it lands this would happen on every TTL expiry. The same root cause shows up in a narrower window too. If an FDv1 result has already been posted when the retry runs, it is applied after FDv2 has restarted, and it calls
Branch with a test and a fix
With the fix, the full client unit suite passes (236 tests). Another way to fix it is to put the TTL future into the same A heads-up, not verified: the server SDK's |
f0596a8 to
859218a
Compare
There was a problem hiding this comment.
Risk: high.
Automated risk review (dry run): High
This PR would not be automatically approved. Human approval required.
Why: Client FDv2 fallback in fdv2_data_source.cpp and fdv1_adapter_synchronizer.cpp changes live streaming, and unresolved Bugbot findings include a high-severity stale shutdown that can drop the active synchronizer after the fallback TTL.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver




Summary
Honors the service's directive to move the client off FDv2 back to FDv1, and provides an FDv1 source to fall back to.
Note
Overview
Adds
FDv1AdapterSynchronizer, which wraps an existing FDv1 client source so it can participate in the FDv2 synchronizer pipeline—translatingInit/Upsert/Applyinto full or partial changesets (without selectors) and mapping data-source status errors to FDv2 interrupted/terminal results.FDv2DataSourcenow reacts when a result carries anfdv1_fallbackdirective (from initializers or synchronizers): it still applies any accompanying payload, switches the source manager to the configured FDv1 fallback tier, and schedules a cancellable timer to re-attempt FDv2 after the directive TTL. If the service requests FDv1 but no fallback synchronizer is configured, the client moves to interrupted instead of continuing FDv2. Close cancels any pending retry timer.Coverage includes adapter lifecycle/conversion tests and FDv2 orchestration tests for apply-on-fallback, FDv1 tier startup, missing fallback, and TTL-based FDv2 retry.
Reviewed by Cursor Bugbot for commit 859218a. Bugbot is set up for automated code reviews on this repo. Configure here.